package hy.controller;

import hy.service.UserService;
import hy.service.impl.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UerCtr {
    @Autowired
    UserService service;

    @GetMapping("/m1")
    public List<String> handle1(){
        return service.getUserInfo();
    }

    @ExceptionHandler(Exception.class)
    public String e3(Exception e){
        e.printStackTrace();
        return e.getMessage();
    }
}
